<template>
	<view class="" v-if="flags==true">
		<image src="https://web.78keji.cn/images/tcxcx/topx.png" mode="widthFix"
			style="width: 100%;position: absolute;z-index: 1;top: -120rpx;"></image>
		<image src="https://web.78keji.cn/images/tcxcx/cupons.png" mode="widthFix"
			style="width: 702rpx;position: absolute;top: 103rpx;z-index: 2;left: 24rpx;"></image>
		<view class="d_f bos" style="position: absolute;z-index: 3;top: 140rpx;">
			<view class="">
				停车费用(元)
			</view>
			<view class="">
				100
			</view>

		</view>
		<view class="d_f boss1" style="position: absolute;z-index: 3;top: 263rpx;">
			<view class="" style="color: #999999;">
				停车时长
			</view>
			<view class="">
				10小时52分钟
			</view>

		</view>
		<view class="d_f boss1" style="position: absolute;z-index: 3;top: 301rpx;">
			<view class="" style="color: #999999;">
				入场时间
			</view>
			<view class="">
				2024-04-19 02:50:38
			</view>

		</view>
		<view class="d_f boss1" style="position: absolute;z-index: 3;top: 334rpx;">
			<view class="" style="color: #999999;">
				车牌号
			</view>
			<view class="">
				川A***45
			</view>

		</view>
		<view class="d_f boss1" style="position: absolute;z-index: 3;top: 370rpx;">
			<view class="" style="color: #999999;">
				收费规则
			</view>
			<view class="">
				10元/小时，每日100元封顶
			</view>

		</view>


		<!-- 	<view class="second" v-if="is==0">
		<view class="">
			活动推荐
		</view>
		<view class="d_f" style="margin-top: 24rpx;">
			<view class="">
				<image @click="activityNoOpen" src="https://web.78keji.cn/images/tcxcx/left.png" mode="widthFix" style="width:318rpx;"></image>
			</view>
			<view class="" style="margin-left: 18rpx;">
				<image  @click="activityNoOpen" src="https://web.78keji.cn/images/tcxcx/szmf.png" mode="widthFix" style="width:318rpx;"></image>
				<image @click="activityNoOpen"  src="https://web.78keji.cn/images/tcxcx/mflq.png" mode="widthFix" style="width:318rpx;margin-top: 10rpx;"></image>
			</view>
		</view>
	</view> -->
		<!-- 	<view class="bossx">
		<view class="" style="text-align: center;" v-if="is==0">
			<view class="bottom" >
				<view class="" v-for="(item,index) in lists " :key='index'>
					<image :src='item.image' style="width: 100%;margin-top: 26rpx;height: 180rpx;" @tap="changes(item.url)">
					</image>
				</view>
			</view>
		
		</view>
	</view> -->
		<view class="bottoms d_f ">
			<view class="" style="#292929;font-size: 26rpx;margin-left: 47rpx;">
				合计：
			</view>
			<view class="" style="color: #F06736; font-size: 44rpx;">
				￥100.00
			</view>
			<view class="zf" @click="zf">
				立即缴费
			</view>
		</view>
	</view>
	<view class="main-box" v-else>
		<view class="list-box">

			<image src="https://web.78keji.cn/images/tcxcx/noorders.png" mode="widthFix" style="width: 350rpx;"></image>
		</view>
	</view>
</template>

<script>
	import {
		getid,
		getnew,
		sendSms,
		loginx,
		shenhe,
		getAliUseridPz,
		getBanner,
		tcjfOrder
	} from '../../api/index.js'
	import messageUtil from '../../utils/messageUtil.js';
	export default {
		data() {
			return {
				lists: [],
				is: '',
				flags: false
			};
		},
		onLoad(option) {


			if (option.plate == "川A12345") {
				this.flags = true
			}
			getBanner().then((res) => {
				console.log(res)
				this.lists = res.data.list5
			})

			shenhe({
				pid: 1,
				ver: 25
			}).then((res) => {
				console.log(res)
				this.is = res.data.is
			})

		},
		methods: {
			activityNoOpen() {
				messageUtil.showMsg('活动暂未开启')
			},
			zf() {
				tcjfOrder({
					user_id: my.getStorageSync({
						key: 'user'
					}).data,
					carNum: '川A12345'
				}).then((resx) => {
					my.tradePay({
						// 调用统一收单交易创建接口（alipay.trade.create），获得返回字段支付宝交易号 trade_no
						tradeNO: resx.data.trade_no,
						success: res => {

						},
						fail: error => {
							console.error('调用 my.tradePay 失败: ', JSON.stringify(error));
						},
					});
				})
			},
			changes(e) {
				console.log(e) //h5链接
				// 	//支付宝蚂蚁保（免费领5元话费立减金）
				let link = "https://render.alipay.com/p/s/i/?scheme=" + encodeURIComponent(
						"alipays://platformapi/startapp?saId=10000007&clientVersion=3.7.0.0718&qrcode="
					) +
					encodeURIComponent(encodeURIComponent(e))
				my.ap.navigateToAlipayPage({
					path: link
				})
			},
		}
	}
</script>

<style lang="scss">
	.main-box {
		background-color: #f6f6f8;
		padding-top: 20rpx;
		min-height: 100vh;
	}

	.dingdan {
		height: 100%;
		text-align: center;

	}

	.list-box {
		padding-top: 400rpx;
		text-align: center;
	}

	.bos {
		color: #1A1A1A;
		font-size: 32rpx;
		width: 100%;
		padding: 0 48rpx;
		justify-content: space-between;
	}

	.boss1 {

		font-size: 24rpx;
		width: 100%;
		padding: 0 48rpx;
		justify-content: space-between;
	}

	.second {
		position: absolute;
		width: 702rpx;
		height: 500rpx;
		background: #FFFFFF;
		border-radius: 12rpx;
		top: 486rpx;
		z-index: 9;
		padding: 24rpx;
		left: 24rpx;
	}

	.bossx {
		position: absolute;
		top: 980rpx;
		z-index: 9999;
		width: 702rpx;
		left: 24rpx;
		padding-bottom: 100rpx;


	}

	.bottoms {
		width: 100%;
		height: 132rpx;
		background: #FFFFFF;
		position: fixed;
		bottom: 0;
		z-index: 9999;
		align-items: center;
	}

	.zf {
		width: 367rpx;
		height: 90rpx;
		background: #167BFF;
		border-radius: 6rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		color: #FFFFFF;
		margin-left: 74rpx;
	}
</style>